package com.zjx;


import com.zjx.Service.StudentService;
import com.zjx.entity.Student;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class MainTest {

	public static void main(String[] args) throws Exception {
		ApplicationContext context = new ClassPathXmlApplicationContext("spring/spring-tx-config.xml");
		StudentService studentService = (StudentService) context.getBean("studentService");
		Student student = new Student();
		student.setName("lc");
		student.setAge(18);
		student.setSex("女");
		//保存一条记录
		studentService.save(student);
	}

}
